package com.aliyun.heiyu.powermaster.server;

import com.aliyun.heiyu.powermaster.server.factory.MasterThreadFactory;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @ClassName: ZkServerThread
 * @Author: majun
 * @Description:
 * @Date: Created in 2019/11/1 14:25
 */

public class ZkServerThread {

    public ZkServerThread() {
        ZkServer();
    }


    public void ZkServer() {

        ThreadPoolExecutor executorService = new ThreadPoolExecutor(1, 1,
            5, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new MasterThreadFactory("ZkServer"));
        executorService.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    Boolean aBoolean = ToolZookeeper.startClusterZookeeper(null);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }
}
